App.controller('instructionCtrl', ['$rootScope', '$scope', '$state', '$window', 'Page',function($rootScope, $scope, $state, $window, Page) {

	Page.ajaxPost('instruction/query4Mobile.do', null, function(resp){
		$scope.instructionList = resp.data;
		if($scope.instructionList.length > 0) {
			$scope.selectInstruction = $scope.instructionList[0];
		}
	});


	$scope.clickInstruction = function(instruction, event) {
		//console.log(event.currentTarget);
		//移除原有的选中样式
		var preSelect = $(event.currentTarget).parent().find(".list-group-item.active");
		preSelect.removeClass("active");
		//给当前的超链接加上选中样式
		$(event.currentTarget).addClass("active");
		$scope.selectInstruction = instruction;
	}

}]);